package main

import "fmt"

//16ms 43%,6.1MB 16%
func missingNumber(nums []int) int {
	l, r := 0, len(nums)-1
	for l < r {
		m := (l + r) / 2
		if nums[m] > m {
			r = m - 1
		} else {
			l = m + 1
		}
	}
	if nums[l] == l {
		return l + 1
	}
	return l
}

func main() {
	fmt.Println(missingNumber([]int{1}))
}
